$(document).ready(function () {
    var table = $('table#table').DataTable({
        ajax: {
            url: baseUrl + '/datatable',
            data: function (d) {
                d.headerId = headerId;
                return d;
            }
        },
        searchCols: [{
            search: headerId
        }],
        order: [
            [1, 'asc']
        ],
        columns: [
            {
                data: 'waveId',
                defaultContent: '',
                visible: false
            }, {
                name: 'docNumber',
                data: 'docNumber'
            }, {
                name: 'materialCode',
                data: 'materialCode'
            }, {
                name: 'materialName',
                data: 'materialName'
            }, {
                name: 'specModel',
                data: 'specModel'
            }, {
                name: 'waveQtyOrdered',
                data: 'waveQtyOrdered'
            }, {
                name: 'waveQtyShipped',
                data: 'waveQtyShipped'
            }, {
                name: 'soQtyOrdered',
                data: 'soQtyOrdered'
            }, {
                name: 'soQtyShipped',
                data: 'soQtyShipped'
            }, {
                name: 'checkLotNumber',
                data: 'checkLotNumber'
            }, {
                name: 'notes',
                data: 'notes'
            }]
    });
    $('.search-form').on("submit", function (e) {
        table.draw();
        //阻止表单submit
        return false;
    });
});
